<?php
/*
 * @Descripttion: 
 * @Author: dedeye
 * @Date: 2020-02-25 16:24:09
 * @LastEditors: dedeye
 * @LastEditTime: 2020-02-29 14:47:27
 */

namespace app\admin\controller;

class Controller extends \think\Controller
{
    protected $middleware = ['AdminLoginCheck', 'AdminAuthCheck'];

    protected static function checkData($validate, $scene, $data)
    {
        if (!$validate->scene($scene)->check($data)) {
            return $validate->getError();
        }
        return null;
    }

    protected static function isSuperAdmin() {
        if(config('admin.super_admin') == session('admin_id')) {
            return true;
        }
        return false;
    }
}